﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
using RaisingStudio.Data.Common.Configuration;
using RaisingStudio.Common.Xml;
using System.Collections.Specialized;

namespace RaisingStudio.Data.Common.Managers
{
    public sealed class ConverterDeSerializer
    {
        public static Converter Deserialize(XmlNode node)
        {
            Converter converter = new Converter();

            NameValueCollection prop = NodeUtils.ParseAttributes(node);
            converter.DbType = NodeUtils.GetStringAttribute(prop, "dbType");
            converter.Type = NodeUtils.GetStringAttribute(prop, "type");
            converter.ConverterType = NodeUtils.GetStringAttribute(prop, "converterType");
            return converter;
        }
    }
}
